Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
Is `==` still called the "abstract equality operator"?

== used to be called the abstract equality operator, and its abstract equality comparison algorithm was defined in the ECMAScript specification.

This algorithm is now named IsLooselyEqual in the specification, and the term "abstract equality" is no longer used in the specification.

Has the operator been renamed?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You can call == the abstract equality operator because it checks according to the abstract equality comparison algorithm. So, this is a valid, if unofficial, name for it.

The more popular name for this is "loose equality". Also an unofficial name. It is opposed to "strict equality" with ===.


The operator is simply referred to "the equals operator" in ECMAScript 5.

In ECMAScript 6 the specification has an umbrella 12.10 Equality Operators section which groups together ==, !=, ===, and !==. However, parts of the specification do still mention "the equality operator" like 12.10.3 Runtime Semantics: Evaluation which reads the following at the end of the section:

NOTE 2 The equality operators maintain the following invariants:

  • A != B is equivalent to !(A == B).
  • A == B is equivalent to B == A, except in the order of evaluation of A and B.

NOTE 3 The equality operator is not always transitive. For example, there might be two distinct String objects, each representing the same String value; each String object would be considered equal to the String value by the == operator, but the two String objects would not be equal to each other. For example:

  • new String("a") == "a" and "a" == new String("a") are both true.
  • new String("a") == new String("a") is false.

This is still the case in the latest official ECMAScript 12 (2021) specification. The relevant section is 13.11 Equality Operators which still contains ==, !=, ===, and !==. The end of 13.11.1 Runtime Semantics: Evaluation still contains the same notes as ECMAScript 6 did.


Therefore the operator is "the equality operator*. The operation it performs is called the Abstract Equality Comparison in ECMAScript 12 (with an analogous "Strict Equality Comparison" for ===) and recently has been renamed to IsLooselyEqual (with an analogous "IsStrictlyEqual") in the latest (2022) draft.

about 4 years ago · Juan Pablo Isaza Relatório

0

In ECMAScript 5, the == operator was called the "equals operator", and === was called the "strict equals operator".

In ES2022, the term "equality operators" is used to encompass both (and the word-pairing "equals operator" does not occur).

The term "loose equality operator" does not appear in ES2022, although the algorithm used to define its behavior is called IsLooselyEqual.

The term "strict equality operator" does not appear in ES2022, although the algorithm used to define its behavior is called IsStrictlyEqual.

On this basis, I would say == was never* officially called the "abstract equality operator". It was the "equals operator". However, given that this term is no longer used in the specification, perhaps its name has changed to the "equality operator" or possibly the "loose equality operator" (with the converse being the "strict equality operator").

*need to check prior to ES5

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda